package appapi.service.impl;

import appapi.Request.Basic.OperTypeReq;
import appapi.service.OperatingtypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import appapi.dao.OperatingtypeMapper;
import appapi.entity.basic.OperatingTypeEntity;

import java.util.List;

/**
 * 作业类型逻辑
 *
 * @author luocheng
 * @version 1.0
 * @date 2023/05/26 10:56
 */
@Service
public class OperatingtypeServiceImpl extends ServiceImpl<OperatingtypeMapper, OperatingTypeEntity> implements OperatingtypeService {

    @Autowired
    private OperatingtypeMapper operatingtypeMapper;

    @Override
    public List<OperatingTypeEntity> getList(@Param("req") OperTypeReq req) {
//        QueryWrapper<OperatingTypeEntity> wrapper = new QueryWrapper<>();
//        if (StringUtils.isNotBlank(req.getOperTypeName())) {
//            String typeName = req.getOperTypeName();
//            wrapper.like("oper_type_name",typeName);
//        }
        return operatingtypeMapper.selectList(req.getOperTypeName());
    }

    @Override
    public OperatingTypeEntity getDetail(Long operTypeId) {

        return operatingtypeMapper.selectByPrimaryKey(operTypeId);
    }
}
